﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;

namespace ro.fortech.training.mvc.control
{
    public class Controller
    {
        public TimeSpan GetMinutesLate(DateTime time)
        {
            TimeSpan startWork = new TimeSpan(9, 0, 0);
            TimeSpan minutesLate = time.TimeOfDay - startWork;
            AccountController.userLogged.MinLate = minutesLate.ToString();
            AccountController.userLogged.StartWork = time.TimeOfDay;
            return minutesLate;
        }

        public TimeSpan GetWorkDuration(TimeSpan time)
        {
            TimeSpan workDuration;
            User user = AccountController.userLogged;
            workDuration = time - user.StartWork;
            return workDuration;
        }
    }
}
